import Vue from 'vue'
import Viewer from 'v-viewer'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import 'element-ui/lib/theme-chalk/display.css'
import ElementUI from 'element-ui'
import '@/styles/element-variables.scss'
import 'element-ui/lib/theme-chalk/icon.css'
import 'element-ui/lib/theme-chalk/index.css'
import 'viewerjs/dist/viewer.css'
import './icons/font/iconfont.css'

import '@/styles/index.scss'
import '@/directives/index'
import '@/icons' // icon
import '@/permission' // permission control
import App from './App'
import store from './store'
import router from './router'
import VueLazyload from 'vue-lazyload'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import VueDND from 'awe-dnd'
import moment from 'moment-timezone'
import modal from '@/plugins/modal'
import { modalSure } from '@/libs/public'
import * as filters from './filters'
import VueUeditorWrap from 'vue-ueditor-wrap'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import * as constants from '@/utils/constants'
import util from '@/utils/utils'
import goodListFrom from '@/components/goodList/goodListFrom'
import SelfUpload from '@/components/uploadPicture/forGenrator/index'
import uploadPicture from '@/components/uploadPicture/uploadFrom/index'
import uploadIndex from '@/components/uploadPicture'
import vueParticles from 'vue-particles'
import modalAttr from '@/libs/modal-attr'
import attrFrom from '@/components/attrFrom'
import columns from 'v-fit-columns'
import UploadImg from "@/components/Upload";
// 分页组件
import Pagination from '@/components/Pagination'
import { checkURL } from '@/utils/index'

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI, { zIndex: 1000 })
Vue.use(VueDND)
Vue.use(vueParticles)
Vue.use(uploadPicture,{store})
Vue.use(goodListFrom)
Vue.use(columns)
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require('./assets/images/no.png'),
  loading: require('./assets/images/moren.jpg'),
  dispatchEvent: true,
  attempt: 1
})
Vue.use(Viewer)
Viewer.setDefaults({
  Options: {
    zIndex: 9999,
    inline: true,
    button: false,
    navbar: true,
    title: true,
    toolbar: true,
    tooltip: true,
    movable: true,
    zoomable: true,
    rotatable: true,
    scalable: true,
    transition: true,
    fullscreen: true,
    keyboard: true,
    url: 'data-source'
  }
})

Vue.component('vue-ueditor-wrap', VueUeditorWrap)
Vue.component('UploadImg', UploadImg)
Vue.component('attrFrom', attrFrom)
Vue.component('Pagination', Pagination)
Vue.component('SelfUpload', SelfUpload)
Vue.component('uploadIndex', uploadIndex)
Vue.prototype.$selfUtil = selfUtil
Vue.prototype.$moment = moment
Vue.prototype.$modal = modal
Vue.prototype.$modalAttr = modalAttr
Vue.prototype.$modalSure = modalSure
Vue.prototype.$constants = constants
Vue.prototype.$util = util;
// 已经写出来的效果隐藏
Vue.prototype.$IsExhibition = false
// 图片地址
Vue.prototype.$uploadURL = checkURL

// 全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
window.router = router
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
